import java.util.*;

public class Test {
    public static void main(String[] args) {
        Person person = new Person("12345");//不能太长，否则会越界；
        Person person2 = new Person("123456");
        HashBuck2<Person,String> hashBuck2 = new HashBuck2<>();
        hashBuck2.put(person,"zhangsan");
        hashBuck2.put(person2,"lisi");
        System.out.println(hashBuck2.get(person));
        System.out.println(hashBuck2.get(person2));
    }

    public static void main3 (String[] args) {
        HashBuck hashBuck = new HashBuck();
        hashBuck.put(36,6);
        hashBuck.put(12,6);
        hashBuck.put(23,6);
        hashBuck.put(8,6);
        hashBuck.put(45,6);
        System.out.println("------------------");
        System.out.println(hashBuck.get(36));
        hashBuck.put(37,12);
        hashBuck.put(39,2);
        hashBuck.put(31,1);
        hashBuck.put(34,1);
        hashBuck.put(35,1);
    }


    public static void main2(String[] args) {
        Map<String,Integer> map = new TreeMap<>();
        TreeMap<String,Integer> map2 = new TreeMap<>();
        map2.put("a",1);
        map2.put("ab",6);
        map2.put("aldsa",65);
        System.out.println(map2.get("a"));
        System.out.println("---------------");

//        map2.remove("a");
//        System.out.println("----------------");

        System.out.println(map2.getOrDefault("asd", -99999999));
        System.out.println("------------------");

        Set<String> set = map2.keySet();
        for(String s : set) {
            System.out.println(s);
        }
        System.out.println("-----------------");

       Collection<Integer> collection =   map2.values();
        for (Integer integer : collection) {
            System.out.println(integer);
        }
        System.out.println("---------------------");

        Set<Map.Entry<String,Integer>> set1 = map2.entrySet();
        for (Map.Entry<String,Integer> entry : set1) {
            System.out.println(entry);
        }

    }
    public static void main1(String[] args) {
        BinarySearchTree tree = new BinarySearchTree();
        tree.insert(60);
        tree.insert(40);
        tree.insert(10);
        tree.insert(45);
        tree.insert(90);
        tree.insert(70);
        tree.insert(120);
        System.out.println("==================");
    }
}
